﻿<Page x:Class="SoftTeach.View.Stundenentwürfe.MetroStundenentwurfPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:setting="clr-namespace:SoftTeach.Setting"
      mc:Ignorable="d" 
      d:DesignHeight="768" 
      d:DesignWidth="1366"
      Title="Tagesplan"
      DataContext="{Binding Source={x:Static setting:Selection.Instance}, Path=Stunde}"
      FontSize="18">
  <Page.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <ResourceDictionary >
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Page.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Border Grid.Row="0" Background="{StaticResource MetroHeaderBackground}">
      <Label Foreground="White">Verlaufsplan</Label>
    </Border>
    <Grid Grid.Row="1" Margin="5">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <StackPanel Grid.Row="0" Orientation="Horizontal">
        <Label Style="{StaticResource MetroSubHeaderBold}" Content="{Binding Path=LerngruppenterminKlasse, Mode=OneWay}"/>
        <Label Style="{StaticResource MetroSubHeaderBold}">-</Label>
        <Label Style="{StaticResource MetroSubHeaderBold}" Content="{Binding Path=LerngruppenterminFach, Mode=OneWay}"/>
        <Label Style="{StaticResource MetroSubHeader}"></Label>
        <Label Style="{StaticResource MetroSubHeader}" Content="{Binding Path=StundeDatum, Mode=OneWay}"/>
        <Label Style="{StaticResource MetroSubHeader}"></Label>
        <Label Style="{StaticResource MetroSubHeader}" Content="{Binding Path=TerminStundenbereich, Mode=OneWay}"/>
        <Label Style="{StaticResource MetroSubHeader}" Padding="0,5,0,0">.Stunde</Label>
      </StackPanel>
      <StackPanel Grid.Column="1" Orientation="Horizontal">
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddStundennotenCommand}">
          <Image Source="/SoftTeach;component/Images/Note48.png"/>
        </Button>
        <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddHausaufgabenCommand}" ToolTip="Nicht gemachte Hausaufgaben eintragen.">
          <StackPanel Orientation="Horizontal">
            <Grid>
              <Image Source="/SoftTeach;component/Images/Hausaufgabe48.png"/>
              <Image Source="/SoftTeach;component/Images/AddOverlay32.png"/>
            </Grid>
          </StackPanel>
        </Button>
        <Image Visibility="{Binding Path=StundeStundenentwurf.StundenentwurfKopieren, Converter={StaticResource BoolVisibleConverter}}" Margin="5" Source="/SoftTeach;component/Images/Kopierer48.png"/>
        <Image Visibility="{Binding Path=StundeStundenentwurf.StundenentwurfComputer, Converter={StaticResource BoolVisibleConverter}}" Margin="5" Source="/SoftTeach;component/Images/Laptop48.png"/>
      </StackPanel>
    </Grid>
    <Grid Grid.Row="2">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Label Grid.Column="0" Style="{StaticResource MetroHeader}" Padding="5,0"
           Content="{Binding Path=StundeStundenentwurf.StundenentwurfStundenthema}"/>
      <ListView Grid.Column="1"
                SelectedItem="{Binding Path=StundeStundenentwurf.CurrentDateiverweis, Mode=TwoWay}" 
                ItemsSource="{Binding Path=StundeStundenentwurf.Dateiverweise}"
                ItemTemplate="{StaticResource DateiverweiseListViewTile}"
                Background="Transparent" 
                BorderBrush="Transparent" 
                BorderThickness="0">
        <ListView.ItemsPanel>
          <ItemsPanelTemplate>
            <WrapPanel Orientation="Horizontal"/>
          </ItemsPanelTemplate>
        </ListView.ItemsPanel>
      </ListView>
    </Grid>
    <DataGrid Grid.Row="3" Name="PhasenTable" Margin="5"
              Style="{StaticResource MetroDatagridPrintStyle}"
              ItemsSource="{Binding Path=StundeStundenentwurf.Phasen}" 
              AutoGenerateColumns="False"
              RowDetailsVisibilityMode="Collapsed" 
              HorizontalScrollBarVisibility="Disabled" 
              VerticalScrollBarVisibility="Disabled">
      <DataGrid.Columns>
        <DataGridTextColumn Header="Zeit" Binding="{Binding Path=PhaseZeitraum}" Width="Auto"/>
        <DataGridTextColumn Header="Medien" Binding="{Binding Path=PhaseMedium.MediumBezeichnung}" Width="Auto"/>
        <DataGridTextColumn Header="Sozialform" Binding="{Binding Path=PhaseSozialform.SozialformBezeichnung}" Width="Auto"/>
        <DataGridTextColumn Header="Inhalt" Binding="{Binding Path=PhaseInhalt}" Width="*"
                            ElementStyle="{StaticResource DatagridMultilineElementStyle}"
                            EditingElementStyle="{StaticResource DatagridMultilineEditingElementStyle}"/>
      </DataGrid.Columns>
    </DataGrid>
    <Grid Grid.Row="4">
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>
      <StackPanel Grid.Column="0" Margin="5">
        <Label Style="{StaticResource MetroLabelStyle}" FontWeight="Bold" Padding="0,0,0,5">Hausaufgaben</Label>
        <TextBlock Style="{StaticResource MetroLabelStyle}" 
                   Text="{Binding Path=StundeStundenentwurf.StundenentwurfHausaufgaben}"
                   TextWrapping="Wrap"/>
      </StackPanel>
      <StackPanel Grid.Column="1" Margin="5">
        <Label Style="{StaticResource MetroLabelStyle}" FontWeight="Bold" Padding="0,0,0,5">Termine/Ansagen</Label>
        <TextBlock Style="{StaticResource MetroLabelStyle}" 
                   Text="{Binding Path=StundeStundenentwurf.StundenentwurfAnsagen}"
                   TextWrapping="Wrap"/>
      </StackPanel>
    </Grid>
  </Grid>
</Page>
